package com.yy.QSManage.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yy.QSManage.tool.TreeNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.jetbrains.annotations.NotNull;

import java.io.Serializable;

@Data
@Accessors(chain = true)
@ApiModel(description="fa_sys_menu")
public class FaSysMenu extends TreeNode<FaSysMenu> implements Serializable,Comparable<FaSysMenu> {

    @ApiModelProperty(value="名称")
    private String name;

    @ApiModelProperty(value="路由地址")
    private String routerPath;

    @ApiModelProperty(value="路由对象")
    private String router;

    @ApiModelProperty(value="其他路由配置")
    private String otherRouterJson;

    @ApiModelProperty(value="图标")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String icon;

    /**
    * 菜单类型（system：系统菜单，user：用户菜单）
    */
    @ApiModelProperty(value="菜单类型（system：系统菜单，user：用户菜单）")
    private String type;

    /**
     * 排序
     */
    @ApiModelProperty(value="排序")
    private Integer sort;

    /**
    * 备注
    */
    @ApiModelProperty(value="备注")
    private String note;

    @ApiModelProperty(value="关联网格ids")
    @TableField(exist = false)
    private String grids;

    @ApiModelProperty(value="功能权限")
    @TableField(exist = false)
    private String functionRole;

    private static final long serialVersionUID = 1L;

    @Override
    public int compareTo(@NotNull FaSysMenu o) {
        return Integer.compare(o.sort, this.sort);
    }
}